<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>品种点差-修改</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/common/css/Hui-iconfont/1.0.7/iconfont.css"/>
    <style>
        .Validform_checktip{padding-top:5px;display: inline-block;color:red;}
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>品种点差-修改</h5>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal" id="saveFrom" action="__URL__/updateSymbolSpread" method="post">
                            <input type="hidden" name="id" value="{$msg.id}"/>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">品种：</label>
                                <div class="col-sm-8">
                                    <input type="text" name="symbol" value="{$msg.symbol}" placeholder="品种" class="form-control" datatype="*" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                </div>
                                <i class="Validform_checktip Hui-iconfont">*</i>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">点差：</label>
                                <div class="col-sm-8">
                                    <input type="text" name="spread" value="{$msg.spread}" placeholder="点差" class="form-control" datatype="/^[0-9]+(.[0-9]{0,2})?$/" nullmsg="null" errormsg="&#xe706;" sucmsg=" ">
                                </div>
                                <i class="Validform_checktip Hui-iconfont">*</i>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-3 col-sm-8">
                                    <button class="btn btn-sm btn-info" id="save-btn" type="submit">保 存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="Index/common_js"/>
    <!-- 自定义js -->
    <script src="js/content.js?v=1.0.0"></script>
    <script>
        var editor;
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
            editor=UE.getEditor('content');
        });

        $("#saveFrom").Validform({/*添加账号*/
            btnSubmit:"#save-btn",
            ajaxPost:true,
            tiptype: function(msg, o, cssctl) {
                //msg：提示信息;
                //o:{obj:*,type:*,curform:*}, obj指向的是当前验证的表单元素（或表单对象），type指示提示的状态，值为1、2、3、4， 1：正在检测/提交数据，2：通过验证，3：验证失败，4：提示ignore状态, curform为当前form对象;
                //cssctl:内置的提示信息样式控制函数，该函数需传入两个参数：显示提示信息的对象 和 当前提示的状态（既形参o中的type）;
                if (!o.obj.is("form")) { //验证表单元素时o.obj为该表单元素，全部验证通过提交表单时o.obj为该表单对象;
                    var objtip = o.obj.parent().siblings(".Validform_checktip");
                    cssctl(objtip, o.type);
                    objtip.text(msg);
                }
            },beforeSubmit:function(curform){
                index = layer.load();
            },callback:function(data){
                layer.close(index);
                //alert(JSON.stringify(data));return;
                //console.log(data);
                if(data.status==1){
                    layer.msg(data.msg,{icon: 1, time: 2000});
                    location.reload();
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            }
        });
    </script>
</body>

</html>
